/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ServerRMI;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.swing.JPanel;
import shared.*;


public class MyGraphicsView extends JPanel
{
    
    CopyOnWriteArrayList<Bullet> bulletsList = new CopyOnWriteArrayList<Bullet>();
    CopyOnWriteArrayList<Player> playersList = new CopyOnWriteArrayList<Player>();
    private Map map = new Map();

    public MyGraphicsView()
    {
        setPreferredSize(new Dimension(600, 600));
    }

    @Override
    protected void paintComponent(Graphics g)
    {
        super.paintComponent(g);
        Graphics2D g2d = (Graphics2D) g;

        map.draw(g2d);
        
        for (Player play : playersList)
            play.draw(g2d);

        for (Bullet bull : bulletsList)
            bull.draw(g2d);
        
    }


}
